import 'package:flutter/material.dart';
import 'package:flutter_api/service/model/home_model.dart';

// 首页知识点列表item
class HomeListItem extends StatelessWidget {
  final HomeModel _homeModel;

  HomeListItem(this._homeModel);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      child: Card(
        child: Container(
          child: ListTile(
            trailing: Icon(
              Icons.arrow_forward_ios,
              size: 24,
              color: Colors.black54,
            ),
            title: Text(
              _homeModel.title,
              style: TextStyle(
                  fontSize: 16,
                  color: Colors.black87,
                  fontWeight: FontWeight.w400),
            ),
            subtitle: Text(
              _homeModel.subTitle,
              style: TextStyle(
                fontSize: 12,
                color: Colors.black54,
              ),
            ),
          ),
        ),
      ),
      onTap: () => Navigator.of(context).pushNamed(_homeModel.router),
    );
  }
}
